找传奇、传世资源到传世资源站!
Java 正文

DVD管理系统,简单的java实例(含数据库文件opt/frm文件)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

一个DVD管理 可登陆等
DVD管理系统,简单的java实例(含数据库文件opt/frm文件) Java-第1张 private void loginActionPerformed(ActionEvent evt) {
String userName=this.userNameTxt.getText();
String password=new String(this.passwordTxt.getPassword());
User user=new User(userName);

new UserFrm(user);
if(StringUtil.isEmpty(userName)) {
JOptionPane.showMessageDialog(null,"用户名不能为空!");
return;
}
if(StringUtil.isEmpty(password)) {
JOptionPane.showMessageDialog(null,"密码不能为空!");
return;
}
User user1=new User(userName,password);
Connection con=null;
try {
con=dbUtil.getCon();
User currentUser=userDao.longin(con, user1);
if(currentUser!=null) {
dispose();
new MainFrm().setVisible(true);
JOptionPane.showMessageDialog(null,"登录成功!");
}else {
JOptionPane.showMessageDialog(null,"用户名或者密码错误!");
}
} catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
private void loginActionPerformed1(ActionEvent evt) {
String userName=this.userNameTxt.getText();
String password=new String(this.passwordTxt.getPassword());
if(StringUtil.isEmpty(userName)) {
JOptionPane.showMessageDialog(null,"用户名不能为空!");
return;
}
if(StringUtil.isEmpty(password)) {
JOptionPane.showMessageDialog(null,"密码不能为空!");
return;
}
User user=new User(userName,password);
Connection con=null;
try {
con=dbUtil.getCon();
User currentUser=userDao.longin(con, user);
if(currentUser!=null) {
dispose();
new UserFrm(user).setVisible(true);
JOptionPane.showMessageDialog(null,"登录成功!");
}else {
JOptionPane.showMessageDialog(null,"用户名或者密码错误!");
}
} catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}finally{

try {
dbUtil.closeCon(con);
} catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}}

}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复